package android.longs.study.home.servlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import android.longs.study.base.HomeServlet;
import android.longs.study.home.service.MobleHomeService;

/**
 * Servlet implementation class MobleHomeServlet2
 */
@WebServlet("/home/list")
public class MobleHomeServlet2 extends HomeServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public MobleHomeServlet2() {
        super();
        // TODO Auto-generated constructor stub
    }
    
    private MobleHomeService mobleHomeService = new MobleHomeService();


	@Override
	public void doRequestFunction(HttpServletRequest request,
			HttpServletResponse response) {
		// TODO Auto-generated method stub

		try {
			String queryAllModels = mobleHomeService.queryAllModels(request);
			System.out.println(queryAllModels);
			response.getWriter().write(queryAllModels);
		} catch (Exception e) {
			// TODO: handle exception
			System.err.println(e.getMessage());
		}
	}

}
